POV-Ray : Newsgroups : povray.advanced-users : Help please: eval_pigment rgb expression to float : Help please: eval_pigment rgb expression to float Server Time
29 Jul 2024 08:12:04 EDT (-0400)
  Help please: eval_pigment rgb expression to float  
From: Andrew Cocker
Date: 16 Aug 2002 11:43:05
Message: <3d5d1d89$1@news.povray.org>
Hi,

I'm trying to vary the size of each sphere in a 100x100 grid by sampling a bozo
pigment. I
haven't used eval_pigment before and I'm finding that it is returning a color
expression, and
I require a float, but I cannot work out how to convert between the two. I am
requiring a
float in the range 0..1.

Here's my code:

#declare MyPigment =
pigment {
bozo
scale 100
color_map {
[0 rgb 0]
[1 rgb 1]
}
}

union {

#declare LR=1;
#while (LR<=100)
   #declare IO=1;
   #while (IO<=100)
   #local Radi = eval_pigment (MyPigment,<LR,0,IO>);
   sphere {<0,0,0>,Radi translate <LR-50,0,IO-50> pigment {rgb <1,1,0>}}
   #declare IO=IO+1;
   #end
#declare LR=LR+1;
#end

}

All the best,

Andy Cocker


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.